#include <iostream>
using namespace std;

// 前向声明
class Car;

class Boat {
    double weight;
public:
    Boat(double w) : weight(w) {}
    double getWeight() const { return weight; }
    friend double calculateTotalWeight(const Boat& boat, const Car& car);
};

class Car {
    double weight;
public:
    Car(double w) : weight(w) {}
    double getWeight() const { return weight; }
    friend double calculateTotalWeight(const Boat& boat, const Car& car);
};

double calculateTotalWeight(const Boat& boat, const Car& car) {
    return boat.weight + car.weight;
}

int main() {
    Boat myBoat(1500.0);
    Car myCar(1200.0);

    double totalWeight = calculateTotalWeight(myBoat, myCar);
    cout << "总重量: " << totalWeight << endl;

    return 0;
}